package com.example.entity;

import org.apache.flink.connector.jdbc.datasource.statements.JdbcQueryStatement;

import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Author wangJinLong
 * Date 2025/8/22 15:45
 **/
public class CustomerJdbcStatement implements Serializable, JdbcQueryStatement<Customer> {
    private static final long serialVersionUID = 1L;

    @Override
    public String query() {
        return "insert into customers_kafka (featuresId, siteSn, captureTime) values (?, ?, ?)";
    }

    @Override
    public void statement(PreparedStatement ps, Customer customer) throws SQLException {
        ps.setString(1, customer.getFeaturesId());
        ps.setString(2, customer.getSiteSn());
        ps.setString(3, Long.toString(customer.getCaptureTime()));
    }
}
